/**
 * 
 */
package cn.edu.cdtu.healthserver.domain;

/**
 * @author 
 *
 */
public class HealthFileBody {
	private int vitaminA;
	private int vitaminB;
	private int vitaminC;
	private int vitaminE;
	private int lecithin;
	private int calcium;
	private int aminoAcid;
	private int TraceElements;
	private String bodyAdvice;
	
	public HealthFileBody(){
		
	}

	
	
	@Override
	public String toString() {
		return "HealthFileBody [vitaminA=" + vitaminA + ", vitaminB="
				+ vitaminB + ", vitaminC=" + vitaminC + ", vitaminE="
				+ vitaminE + ", lecithin=" + lecithin + ", calcium=" + calcium
				+ ", aminoAcid=" + aminoAcid + ", TraceElements="
				+ TraceElements + ", bodyAdvice=" + bodyAdvice + "]";
	}



	public HealthFileBody(int vitaminA, int vitaminB, int vitaminC,
			int vitaminE, int lecithin, int calcium, int aminoAcid,
			int traceElements, String bodyAdvice) {
		super();
		this.vitaminA = vitaminA;
		this.vitaminB = vitaminB;
		this.vitaminC = vitaminC;
		this.vitaminE = vitaminE;
		this.lecithin = lecithin;
		this.calcium = calcium;
		this.aminoAcid = aminoAcid;
		this.TraceElements = traceElements;
		this.bodyAdvice = bodyAdvice;
	}



	public HealthFileBody(int vitaminA, int vitaminB, int vitaminC,
			int vitaminE, int lecithin, int calcium, int aminoAcid,
			int traceElements) {
		super();
		this.vitaminA = vitaminA;
		this.vitaminB = vitaminB;
		this.vitaminC = vitaminC;
		this.vitaminE = vitaminE;
		this.lecithin = lecithin;
		this.calcium = calcium;
		this.aminoAcid = aminoAcid;
		this.TraceElements = traceElements;
		
		StringBuilder sb = new StringBuilder();
		
		if(vitaminA>=100){
			sb.append("维生素A严重缺乏");
		}else if(vitaminA>=50){
			sb.append("维生素A中度缺乏");
		}else{
			sb.append("维生素A轻度缺乏");
		}
		sb.append(";").append('\n');
		if(vitaminB>=100){
			sb.append("维生素B严重缺乏");
		}else if(vitaminB>=50){
			sb.append("维生素B中度缺乏");
		}else{
			sb.append("维生素B轻度缺乏");
		}
		sb.append(";").append('\n');
		if(vitaminC>=100){
			sb.append("维生素C严重缺乏");
		}else if(vitaminC>=50){
			sb.append("维生素C中度缺乏");
		}else{
			sb.append("维生素C轻度缺乏");
		}
		sb.append(";").append('\n');
		if(vitaminE>=100){
			sb.append("维生素E严重缺乏");
		}else if(vitaminE>=50){
			sb.append("维生素E中度缺乏");
		}else{
			sb.append("维生素E轻度缺乏");
		}
		sb.append(";").append('\n');
		if(lecithin>=100){
			sb.append("卵磷脂严重缺乏");
		}else if(lecithin>=50){
			sb.append("卵磷脂中度缺乏");
		}else{
			sb.append("卵磷脂轻度缺乏");
		}
		sb.append(";").append('\n');
		if(calcium>=100){
			sb.append("纤维质钙严重缺乏");
		}else if(calcium>=50){
			sb.append("纤维质钙中度缺乏");
		}else{
			sb.append("纤维质钙轻度缺乏");
		}
		sb.append(";").append('\n');
		if(aminoAcid>=100){
			sb.append("镁氨基酸严重缺乏");
		}else if(aminoAcid>=50){
			sb.append("镁氨基酸中度缺乏");
		}else{
			sb.append("镁氨基酸轻度缺乏");
		}
		sb.append(";").append('\n');
		if(traceElements>=100){
			sb.append("微量元素严重缺乏");
		}else if(traceElements>=50){
			sb.append("微量元素中度缺乏");
		}else{
			sb.append("微量元素轻度缺乏");
		}
		sb.append(";").append('\n');
		
		this.bodyAdvice = sb.toString();
	}
	
	
	
	

	public int getVitaminA() {
		return vitaminA;
	}

	public void setVitaminA(int vitaminA) {
		this.vitaminA = vitaminA;
	}

	public int getVitaminB() {
		return vitaminB;
	}

	public void setVitaminB(int vitaminB) {
		this.vitaminB = vitaminB;
	}

	public int getVitaminC() {
		return vitaminC;
	}

	public void setVitaminC(int vitaminC) {
		this.vitaminC = vitaminC;
	}

	public int getVitaminE() {
		return vitaminE;
	}

	public void setVitaminE(int vitaminE) {
		this.vitaminE = vitaminE;
	}

	public int getLecithin() {
		return lecithin;
	}

	public void setLecithin(int lecithin) {
		this.lecithin = lecithin;
	}

	public int getCalcium() {
		return calcium;
	}

	public void setCalcium(int calcium) {
		this.calcium = calcium;
	}

	public int getAminoAcid() {
		return aminoAcid;
	}

	public void setAminoAcid(int aminoAcid) {
		this.aminoAcid = aminoAcid;
	}

	public int getTraceElements() {
		return TraceElements;
	}

	public void setTraceElements(int traceElements) {
		TraceElements = traceElements;
	}

	public String getBodyAdvice() {
		return bodyAdvice;
	}

	public void setBodyAdvice(String bodyAdvice) {
		this.bodyAdvice = bodyAdvice;
	}



	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + TraceElements;
		result = prime * result + aminoAcid;
		result = prime * result
				+ ((bodyAdvice == null) ? 0 : bodyAdvice.hashCode());
		result = prime * result + calcium;
		result = prime * result + lecithin;
		result = prime * result + vitaminA;
		result = prime * result + vitaminB;
		result = prime * result + vitaminC;
		result = prime * result + vitaminE;
		return result;
	}



	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HealthFileBody other = (HealthFileBody) obj;
		if (TraceElements != other.TraceElements)
			return false;
		if (aminoAcid != other.aminoAcid)
			return false;
		if (bodyAdvice == null) {
			if (other.bodyAdvice != null)
				return false;
		} else if (!bodyAdvice.equals(other.bodyAdvice))
			return false;
		if (calcium != other.calcium)
			return false;
		if (lecithin != other.lecithin)
			return false;
		if (vitaminA != other.vitaminA)
			return false;
		if (vitaminB != other.vitaminB)
			return false;
		if (vitaminC != other.vitaminC)
			return false;
		if (vitaminE != other.vitaminE)
			return false;
		return true;
	}
	
	
	
}
